package com.it2297.view;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;

import com.it2297.controller.ProductController;
import com.it2297.main.UserApp;

import java.awt.FlowLayout;

public class OrderHistory extends JPanel {
	private ProductController pc = new ProductController();
	private static JScrollPane scrollpane = new JScrollPane();
	private int orderID;
	private int id;
	private static String userID;
	public OrderHistory() {
		pc = new ProductController(this);
		initGUI();
	}

	public void initGUI() {
		this.setBounds(100, 100, 750, 570);
		this.add(getScrollpane());
		
		pc.setOrderlistHistory(UserApp.getCurrentUser().getNric());
		pc.addOrderHistory();
		setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
	}

	public static void setPanel(JPanel panel) {
		getScrollpane().getViewport().add(panel);
	}

	public static JScrollPane getScrollpane() {
		return scrollpane;
	}
	public void setUserID(String id){
		this.userID = id;
	}
	public static String getUserID(){
		return userID;
	}

}
